package com.jzx.provider.common.result;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Set;

/**
 * @author daihuihui
 * @date 2019/2/4
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class PageResult<T> extends InvokeResult<T> {
    private Long total;
    private Set<String> highlight;

    public PageResult(T data, Long total, Set highlight) {
        super(data);
        this.total = total;
        this.highlight = highlight;
    }

    public PageResult(T data, Long total) {
        super(data);
        this.total = total;
    }

    public PageResult() {
        super();
    }

    public static <T> PageResult<T> success(T data, Long total) {
        return new PageResult<>(data, total);
    }

    public static <T> PageResult<T> success(T data, Long total, Set highlight) {
        return new PageResult<>(data, total, highlight);
    }
}
